﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DigitalPlatform.Entities;
using DigitalPlatform.IDAL;
using Microsoft.EntityFrameworkCore;

namespace DigitalPlatform.DAL
{
    public class LocalEFService : DbContext, ILocalEFService
    {
        string connstr = "Data Source=DigitalPlatform.bin;";

        public DbContext DBContext => this;
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
            optionsBuilder.UseSqlite(connstr);
        }
        //计划初始化数据库，暂未实现
        public void InitialCatalog()
        {

        }

        public DbSet<DeviceEntity> DeviceList { get; set; }
        public DbSet<ThumbsEntity> ThumbList { get; set; }
    }
}
